const Util = {
  caculatePath :  (rate,r)=>{
    // 百分比
    var progress = rate / 100;
    // 计算当前的进度对应的角度值
    var degrees = progress * 360;

    // 计算当前角度对应的弧度值
    var rad = degrees * (Math.PI / 180);

    // 极坐标转换成直角坐标
    var x = (Math.sin(rad) * r).toFixed(2);
    var y = (r-Math.cos(rad) * r).toFixed(2);
    // 大于180度时候画大角度弧，小于180度的画小角度弧，(deg > 180) ? 1 : 0
    var isOverHalf = Number(degrees > 180);
    if(rate ==100){
        x = -0.000001;
        y = 0
      return {x,y,isOverHalf};
    }else{
      return {x,y,isOverHalf};
    }
  },
  caculateColor :  (startColor,stopColor,rate)=>{

  }
}
export default Util;
